ftpupload()
{
user=$1
passwd=$2
remote_dir=$3
local_dir=$4
file_name=$5
host=$6
today=$(date "+%Y%m%d")
ftp_tmpfile=/tmp/ftp.$$.log 

##############
if [[ -n $host ]];then
	echo "secussfully">/dev/null
else 
	echo "parameter is errr."
	return 1;
fi

###########start upload
ftp -in >$ftp_tmpfile << EOF
open $host
user $user $passwd
bin
cd $remote_dir
mkdir $today
cd $today
lcd $local_dir
prompt off
prompt off
mput $file_name
bye
EOF
#######
result1=0
result2=0
result1=`cat $ftp_tmpfile |grep fail |wc -l`
result1=`cat $ftp_tmpfile |grep refused |wc -l`
result=`expr $result1 + $result2`
if [[ $result -eq 0 ]];then
	echo "Y"
else
	echo "FTP upload error!"
fi

rm -f $ftp_tmpfile >/dev/null
return 1;
}